@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&family=Orbitron:wght@500;700&display=swap');

:root {
    --primary-color: #00f2ff;
    --secondary-color: #ff00c1;
    --background-color: #0a0a14;
    --card-background: rgba(10, 16, 30, 0.85);
    --text-color: #e0e0e0;
    --shadow-color: rgba(0, 242, 255, 0.6);
    --border-color: rgba(0, 242, 255, 0.25);
    --footer-bg: rgba(10, 10, 20, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #000;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.app-container {
    width: 375px;
    height: 812px;
    background-color: var(--background-color);
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: moveGrid 10s linear infinite;
    border-radius: 40px;
    box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 20px var(--shadow-color) inset;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-header, .app-main, .app-footer {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 40px;
    padding-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
}

.app-header h1 {
    font-size: 28px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 10px var(--shadow-color);
}

.chances-counter {
    background: var(--border-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid var(--primary-color);
}

.app-main {
    flex-grow: 1;
    position: relative; /* 定位上下文 */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 视图容器 --- */
.main-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.main-view.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- 能量球 --- */
#blind-box {
    cursor: pointer;
}
.orb-container {
    perspective: 1000px;
    margin: 30px 0;
}
.orb {
    width: 180px;
    height: 180px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}
.orb:hover { transform: scale(1.1); }
.orb-core {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-color) 0%, var(--background-color) 70%);
    box-shadow: 0 0 30px var(--shadow-color), 0 0 60px var(--secondary-color) inset;
    display: flex; justify-content: center; align-items: center;
    font-size: 80px; color: white; text-shadow: 0 0 15px white;
    font-family: 'Orbitron', sans-serif;
}
.orb-ring {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 50%; border: 2px solid;
    border-color: var(--primary-color) transparent;
    animation: rotate 4s linear infinite;
}
.orb-ring:nth-child(2) {
    transform: rotateY(70deg); animation-delay: -0.5s;
    border-color: var(--secondary-color) transparent;
}
.orb-ring:nth-child(3) {
    transform: rotateX(70deg); animation-delay: -1s;
}
.prompt-text {
    font-size: 18px; color: var(--text-color);
    text-shadow: 0 0 8px var(--shadow-color);
    animation: pulse 2s infinite;
    font-family: 'Orbitron', sans-serif;
}

/* --- 轮播组件 --- */
#carousel-container {
    position: relative;
    width: 100%;
    margin: 30px auto;
    overflow: hidden;
}
.carousel-window {
    width: 100%;
    height: 120px;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}
#carousel-track {
    display: flex;
    height: 100%;
    position: relative;
}
.carousel-item {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    margin: 0 10px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.5s ease;
    overflow: hidden;
}
.carousel-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid var(--primary-color);
    filter: blur(4px);
    transition: filter 0.5s ease;
}
.carousel-item.highlight img { filter: blur(0); }
.carousel-item.highlight {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--shadow-color);
}
.carousel-item .nickname {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-color);
}
.carousel-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 0 15px var(--shadow-color), inset 0 0 15px var(--shadow-color);
    z-index: 2;
}

#carousel-container.spinning .carousel-pointer {
    animation: pulse-glow 1.5s infinite;
}

/* --- 无次数提示 --- */
.fallback-container h2 { font-size: 24px; margin-bottom: 10px; text-shadow: 0 0 10px var(--shadow-color); }
.fallback-container p { font-size: 16px; opacity: 0.8; }

/* --- 弹窗 --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1000;
}
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal-content {
    position: relative;
    padding: 5px;
    background: transparent;
}
.modal-overlay.visible .modal-content {
    animation: modal-pop-in 0.4s forwards;
}
.close-button {
    position: absolute;
    top: -10px; right: -10px;
    width: 30px; height: 30px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: var(--background-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 0 10px var(--shadow-color);
}
.close-button:hover { transform: scale(1.1) rotate(90deg); }

/* --- 结果卡片样式 --- */
.card {
    width: 340px;
    background: var(--card-background);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 25px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 15px var(--shadow-color) inset;
    color: var(--text-color);
}
.card-header {
    display: flex; align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
#avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
    margin-right: 20px;
    box-shadow: 0 0 15px var(--shadow-color);
    filter: none;
}
.user-info h2 { font-size: 24px; margin: 0; font-family: 'Orbitron', sans-serif;}
.basic-info span {
    font-size: 16px; background: var(--primary-color);
    color: var(--background-color); padding: 3px 8px;
    border-radius: 5px; font-weight: bold;
}
.card-body h3 {
    margin-top: 20px; margin-bottom: 10px;
    color: var(--primary-color); text-transform: uppercase;
    font-size: 14px; letter-spacing: 1px;
    font-family: 'Orbitron', sans-serif;
}
.card-body p { line-height: 1.6; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.tags span {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--border-color);
    padding: 8px 12px; border-radius: 15px;
    font-size: 13px;
}
.card-footer { 
    margin-top: 25px;
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 10px;
}
.footer-button {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    background: transparent;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.footer-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.footer-button.secondary {
    color: #888;
    border-color: #444;
}
.footer-button.secondary:hover {
    background: #444;
    color: var(--text-color);
}
.footer-button.primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 15px var(--shadow-color);
}
.footer-button.primary:hover {
    box-shadow: 0 5px 20px var(--shadow-color);
}

/* --- 撒花画布 --- */
#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 确保画布不会捕获点击事件 */
    z-index: 1002; /* 确保在弹窗之上 */
}

/* --- 底部导航 --- */
.app-footer {
    display: flex;
    justify-content: space-around;
    padding: 10px 20px 20px;
    background: var(--footer-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center;
    color: #888; font-size: 24px; cursor: pointer; transition: color 0.3s;
}
.nav-item span { font-size: 12px; margin-top: 4px; }
.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--shadow-color);
}

/* --- 全局动画 --- */
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes moveGrid { from { background-position: 0 0; } to { background-position: 30px 30px; } }
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}
@keyframes modal-pop-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 15px var(--shadow-color), inset 0 0 15px var(--shadow-color);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 0 0 25px var(--shadow-color), inset 0 0 25px var(--shadow-color), 0 0 35px var(--secondary-color);
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        box-shadow: 0 0 15px var(--shadow-color), inset 0 0 15px var(--shadow-color);
        transform: translate(-50%, -50%) scale(1);
    }
} 